
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>ThinkPHP示例：CURD操作</title>
<load href='__PUBLIC__/Css/common.css' />
<load href="__PUBLIC__/Js/Base.js" />
<load href="__PUBLIC__/Js/prototype.js" />
<load href="__PUBLIC__/Js/mootools.js" />
<load href="__PUBLIC__/Js/Ajax/ThinkAjax.js" />
 </head>
 <body><script language="JavaScript">
 <!--
    function add(){
        window.location.href="__URL__/add";
    }
    function edit(id){
        window.location.href="__URL__/edit/id/"+id;
    }
    function del(id){
        ThinkAjax.send('__URL__/delete','ajax=1&id='+id,complete,'result');
    }
    function complete(data,status){
        if (status==1)
        {
            $('div_'+data).outerHTML = '';
        }
    }
    function sortBy (field){
     alert(window.location.search);
     location.href = "?_order="+field+"&_sort=";

    }

    
 //-->
 </script>
 <div class="main">
 <h2>ThinkPHP示例之：CURD操作</h2>
方便地完成对单表的CURD操作<P>
 <div id="list" > 
 <table border=1 cellpadding=2 cellspacing=2>
  <tr>
    <td colspan="20"><input type="button" value="新 增" class="small button" onClick="add()"><div id="result" class="none result" style="font-family:微软雅黑,Tahoma;letter-spacing:2px"></div></td>
 </tr>
 <tr><td colspan="20">  {$page}</td>  </tr>
  <tr>
 
 
    <tr><th><a  href="javascript:sortBy('id')">编号</a></th><th><a  href="javascript:sortBy('title')">标题</a></th><th><a  href="javascript:sortBy('content')">内容</a></th><th><a  href="javascript:sortBy('user_id')">用户编号</a></th><th><a  href="javascript:sortBy('create_time')">创建时间</a></th><th><a  href="javascript:sortBy('update_time')">更新时间</a></th><th><a  href="javascript:sortBy('status')">状态</a></th><th><a  href="javascript:sortBy('email')">邮箱</a></th><th colspan=20>操作</th></tr>
    <volist name="list" id="vo">
     		<tr>
			<td>{$vo.id}</td><!--
			<td>id</td>
		-->

			<td>{$vo.title}</td><!--
			<td>title</td>
		-->

			<td>{$vo.content}</td><!--
			<td>content</td>
		-->

			<td>{$vo.user_id}</td><!--
			<td>user_id</td>
		-->

			<td>{$vo.create_time}</td><!--
			<td>create_time</td>
		-->

			<td>{$vo.update_time}</td><!--
			<td>update_time</td>
		-->

			<td>{$vo.status}</td><!--
			<td>status</td>
		-->

			<td>{$vo.email}</td><!--
			<td>email</td>
		-->
<td><input type="button" value="编辑" class="small button" onClick="edit({$vo.id})"> <input type="button" value="删除" class="small button" onClick="del({$vo.id})"></td></tr>
    </volist> 
    </td>
  </tr>
   
 <tr><td colspan="20">  {$page}</td>  </tr>  
 </table>
 

</div>
 </body>
</html>
